// 利用多态实现制作不同饮品
#include <iostream>
using namespace std;
class AbstractDrinking {
public:
    virtual void BoilWater() = 0;
    virtual void Brew() = 0;
    virtual void Pour() = 0;
    virtual void PutThing() = 0;
    void MakeDrink() {
        BoilWater();
        Brew();
        Pour();
        PutThing();
    }
};
class Coffee: public AbstractDrinking {
public:
    void BoilWater() {
        cout << "冲水" << endl;
    }
    void Brew() {
        cout << "冲咖啡" << endl;
    }
    void Pour() {
        cout << "倒出来" << endl;
    }
    void PutThing() {
        cout << "放咖啡辅料" << endl;
    }
};
class Tea: public AbstractDrinking {
public:
    void BoilWater() {
        cout << "冲水" << endl;
    }
    void Brew() {
        cout << "冲茶叶" << endl;
    }
    void Pour() {
        cout << "倒出来" << endl;
    }
    void PutThing() {
        cout << "放茶叶辅料" << endl;
    }
};
void doDrinking(AbstractDrinking * absd) {
    absd->MakeDrink();
    delete absd;
}
void test1() {
    doDrinking(new Coffee);
    cout << "--------------------" << endl;
    doDrinking(new Tea);
}
int main(void) {
    test1();
    
    return 0;
}